package com.dhcc.DRGsHosp.web.controller;

import com.dhcc.DRGsHosp.core.domain.IndexCal;
import com.dhcc.DRGsHosp.facade.FeeAnalysisDepFacade;
import org.openkoala.koala.commons.InvokeResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/feeAnalysisDep")
public class FeeAnalysisDepController {
	
	@Autowired
    private  FeeAnalysisDepFacade  feeAnalysisDepFacade;
	
	/**
	 * 科室费用变化趋势
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getDepFeeVareTrend")
	public InvokeResult getDepFeeVareTrend(String dateFrom,String dateTo,String depCode,String hospCode, String pType, String groupCode) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getDepFeeVareTrend(dateFrom,dateTo,depCode,hospCode,pType, groupCode);
		return InvokeResult.success(list);	
	}
	/**
	 * 不同特征区间内病例分布情况
	 * @param dateFrom
	 * @param dateTo
	 * @param depCode
	 * @param hospCode
	 * @param sliderValBench
	 * @param compareObj
	 * @param compareType
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getDepOverFeeCaseShow")
	public InvokeResult getDepOverFeeCaseShow(String dateFrom,String dateTo,String depCode,String hospCode,
			String sliderValBench,String compareObj, String compareType, String pType, String groupCode) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getDepOverFeeCaseShow(dateFrom,dateTo,
				depCode,hospCode,sliderValBench,compareObj,compareType, pType, groupCode);
		return InvokeResult.success(list);	
	}
	/**
	 * 排除特异病例后次均费用.费用构成及其对比情况表
	 * @param dateFrom
	 * @param dateTo
	 * @param depCode
	 * @param hospCode
	 * @param sliderValBench
	 * @param compareObj
	 * @param compareType
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getDepFeeOutAbnormalTable")
	public InvokeResult getDepFeeOutAbnormalTable(String dateFrom,String dateTo,String depCode,String hospCode,
			String sliderValBench,String compareObj, String compareType,String compareAbnormal,String pType, String groupCode) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getDepFeeOutAbnormalTable(dateFrom,dateTo,
				depCode,hospCode,sliderValBench,compareObj,compareType,compareAbnormal, pType,  groupCode);
		return InvokeResult.success(list);	
	}
	/**
	 * 排除特异病例后次均费用.费用构成及其对比情况表(主诊组维度)
	 * @param dateFrom
	 * @param dateTo
	 * @param depCode
	 * @param hospCode
	 * @param sliderValBench
	 * @param compareTip
	 * @param compareObj
	 * @param compareType
	 * @param compareAbnormal
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getDepFeeOutAbnormalZZZ")
	public InvokeResult getDepFeeOutAbnormalZZZ(String dateFrom,String dateTo,String depCode,String hospCode,
			String sliderValBench,String compareTip,String compareObj, String compareType,String compareAbnormal,String pType) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getDepFeeOutAbnormalZZZ(dateFrom,dateTo,
				depCode,hospCode,sliderValBench,compareTip,compareObj,compareType,compareAbnormal, pType);
		return InvokeResult.success(list);	
	}
	/**
	 * 科室费用分析病例区间分布的病例数点击下的病例明细页面
	 * @param indexCal
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/loadFeeAnalysisCaseTable")
	public InvokeResult loadFeeAnalysisCaseTable(IndexCal indexCal) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.loadFeeAnalysisCaseTable(indexCal);
		return InvokeResult.success(list);
	}


	/**
	 * 不同特征区间内病例分布情况
	 * @param indexCal
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getDRGOverFeeCaseShow")
	public InvokeResult getDepOverFeeCaseShow(IndexCal indexCal) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getDRGOverFeeCaseShow(indexCal);
		return InvokeResult.success(list);
	}
	/**
	 * 数据库现有的绩效值的指标获取
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getManagerQuotaCode")
	public InvokeResult getManagerQuotaCode(String dateTo, String pType) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getManagerQuotaCode(dateTo, pType);
		return InvokeResult.success(list);
	}
	/**
	 * DRG病组次均费用、费用构成及其对比情况表数据获取
	 * @param indexCal
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getDrgCompareData")
	public InvokeResult getDrgCompareData(IndexCal indexCal) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getDrgCompareData(indexCal);
		return InvokeResult.success(list);
	}
	/**
	 * 病组展开的 次均费用、费用构成及其对比情况表
	 * @param indexCal
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/getDrgFeeCompareTable")
	public InvokeResult getDrgFeeCompareTable(IndexCal indexCal) {
		List<Map<String,Object>> list = feeAnalysisDepFacade.getDrgFeeCompareTable(indexCal);
		return InvokeResult.success(list);
	}
}
  
